﻿Public Class KasaOdemeRaporu : Inherits ProcessReport

	Dim aralik As Input

	Public Overrides Sub GenericEvent(ByVal e As ProcessEventArgs)
		Select Case e.EventType
			Case EventType.Initialize
				Start("Kasa Ödemeleri Raporu", "Tarih aralığını girin.")
				aralik = AddDateRange("Tarih", "nl", YMD(Today.Date), YMD(Today.Date), "Tarih aralığını girmelisiniz.", "Tarih aralığını girmelisiniz.")
			Case EventType.ValidateForm
				e.Result = True
			Case EventType.CoverPage
				Rs = Kasa.OdemeOzeti(Local, aralik(1).Get, aralik(2).Get)
				Report.PrintReportInfo("KASA ÖDEMELERİ RAPORU", "ŞUBE: " & Department.SubeAdi(CurrentDepartment) & ", TARİH: " & FormatDateInterval(aralik(1).Get, aralik(2).Get))
				Report.SetColumns("Hesap No.;Hesap Adı;Adet;Tutar", "2;8;1;2", "c;l;n;m", "--")
				Do Until Rs.EOF
					Report.Print(Rs("hesappno"), Rs("acik"), Rs("adet"), Rs("tahsilat"))
					Rs.MoveNext()
				Loop
				Report.PrintTotal("", "", Rs.Sum("adet"), Rs.Sum("tahsilat"))
				Report.EndPage()
				Rs = Kasa.OdemeListesi(Local, aralik(1).Get, aralik(2).Get)
			Case EventType.PageHeader
				Report.PrintReportInfo("KASA ÖDEMELERİ RAPORU", "ŞUBE: " & Department.SubeAdi(CurrentDepartment) & ", TARİH: " & FormatDateInterval(aralik(1).Get, aralik(2).Get))
				Report.SetColumns("Tarih;Fiş No.;Adı;Hesap No.;Tutar", "1;1;4;1;2", "d;r;l;c;m", "--")
			Case EventType.ReportDetail
				Do Until Rs.EOF
					Report.Print(Rs("islemtar"), Rs("fisno"), Rs("adi"), Rs("hesappno"), Rs("borc"))
					Rs.MoveNext()
				Loop
		End Select
	End Sub

End Class
